import request from '@/utils/request'

/**
 * 查询物流商列表
 * @param {Object} query - 查询参数，包括分页、筛选条件等
 * @returns {Promise} - 返回物流商数据和分页信息
 */
export function listCarrierInfo(query) {
    return request({
        url: '/delivery/carrier/list',
        method: 'get',
        params: query,
    });
}

/**
 * 新增物流商
 */
export function addCarrierInfo(data) {
    return request({
        url: '/delivery/carrier/add',
        method: 'post',
        data,
    });
}

/**
 * 更新物流商
 */
export function updateCarrierInfo(data) {
    return request({
        url: '/delivery/carrier/update',
        method: 'put',
        data,
    });
}

/**
 * 删除物流商
 */
export function deleteCarrierInfo(carrierNo) {
    return request({
        url: `/delivery/carrier/delete/${carrierNo}`,
        method: 'delete',
    });
}

/**
 * 批量删除物流商
 */
export function deleteCarriers(carrierNos) {
    return request({
        url: '/delivery/carrier/batchDelete',
        method: 'post',
        data: carrierNos,
    });
}